from django.conf import settings
from application.celery import app
from django.core import mail


# Celery 任务：发送验证码邮件
@app.task
def send_email_task(email, subject, message):
    print("发送邮件任务开始执行...")
    mail.send_mail(subject=subject, message=message, from_email=settings.EMAIL_HOST_USER, recipient_list=[email])
    print("发送邮件任务执行完毕！")
